{% macro render_horizontal_form(form) %}
    <div class="col-sm-offset-2">
        <form class="form-horizontal" action="" method="post">
            {{ form.hidden_tag() }}
            {% for field in form %}
                {% if field.type !='CSRFTokenField' and field.type!='SubmitField' %}
                    <div class="form-group">
                        {{ field.label(class='control-label col-sm-2') }}
                        <div class="col-sm-4">
                            {{ field(class='form-control') }}
                        </div>
                    </div>
                {% endif %}
            {% endfor %}
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-4">
                    {% for s_field in form %}
                        {% if s_field.type=='SubmitField' %}
                            {{ s_field(class='btn btn-primary') }}
                        {% endif %}
                    {% endfor %}
                    <button class="btn btn-default" type="button" onclick="javascript:history.back(-1)">back</button>
                </div>
            </div>
        </form>
    </div>
{% endmacro %}
